package extreme.fizzbuzz.gildedrose;

/**
 * ClassName: BackstagePass
 * Description:
 * Date: 2022/2/15 19:58
 *
 * @author YangXin
 */
public class BackstagePass {

    private int sellIn;
    private int quantity;

    public BackstagePass(int sellIn, int quantity) {
        this.sellIn = sellIn;
        this.quantity = quantity;
    }

    public void oneDayPass() {
        if (sellIn <= 0) {
            quantity = -1;
        }
        if (sellIn > 0 && sellIn <= 5) {
            quantity = quantity + 2;
        }
        if (sellIn > 5 && sellIn <= 10) {
            quantity = quantity + 1;
        }
        sellIn = sellIn - 1;
        quantity = quantity + 1;
        if (quantity > 50) {
            quantity = 50;
        }
    }

    public int getSellIn() {
        return sellIn;
    }

    public int getQuantity() {
        return quantity;
    }
}
